package com.smartplatform.pojo;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.ToString;
import org.springframework.util.StringUtils;

@ToString
@Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class SysCategory implements CheckNull {

    private Long cId;
    private String categoryName;
    private String txCommand;
    private String rxCommand;
    private String commandName;
    private Long status;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private java.util.Date createTime;
    private String createBy;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private java.util.Date updateTime;
    private String updateBy;

    @Override
    public boolean isEmpty(CheckType type) {
        if (type.equals(CheckType.ADD)){
            return !StringUtils.hasText(categoryName);
        }
        return false;
    }
}
